<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/default.xhtml">
	<ui:define name="content">
		<h3>Welcome</h3>

		<h:form styleClass="form-with-border">
			<span> <a href="#{request.contextPath}/login.jsf">Login</a></span>
			
			<h:form id="loginForm" rendered="#{login.loggedIn}">
				<h:form id="userForm" rendered="#{!login.admin}">
					<span> <a href="#{request.contextPath}/vehiclePanel.jsf">Vehicles</a>
					</span>
				</h:form>
				
				<h:form id="adminForm" rendered="#{login.admin}">
					<a href="#{request.contextPath}/registration.jsf">Registration</a>
					<span> <a href="#{request.contextPath}/userPanel.jsf">Users</a>
					</span>
					<a href="#{request.contextPath}/adminVehiclePanel.jsf">Vehicles</a>
				</h:form>
			</h:form>
		</h:form>
		<div>
			<h:outputText value="Logged as #{login.currentUser.person.personName}" rendered="#{login.loggedIn}" />
		</div>
		<h:form>
			<h:commandButton value="Logout" action="#{login.logout}" rendered="#{login.loggedIn}" />
		</h:form>

	</ui:define>
</ui:composition>
